package us.yesor.atlast.framework;

import us.yesor.atlast.InteractionTable;
import us.yesor.atlast.ItemInteraction;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;

/*
 *  Convenience methods for interacting with AtLastContentProvider
 */
public class ContentProviderAdapter {
	
	public static ContentValues getFormattedContentValues(ItemInteraction i){
		ContentValues cv = new ContentValues();
		if (i!=null) {
			cv.put(InteractionTable.COLLECTION, i.getCollection());
			cv.put(InteractionTable.ITEM, i.getItem());
			cv.put(InteractionTable.TRIGGER, i.getTrigger());
			cv.put(InteractionTable.VALUE, i.getValue());
			cv.put(InteractionTable.STATE, i.getState());
			cv.put(InteractionTable.TIME, i.getTime().toString());
		}
		return cv;	
	}
	
	public static Uri insertInteraction(ItemInteraction i) {
		//TODO
		return null;
	}
	
	public static int deleteInteraction(long rowId) {
		//TODO
		return 0;
	}
	
	public static Cursor getItemsByCollection(String collection) {
		//TODO
		return null;
	}
	
	public static Cursor getItemHistory(String item) {
		//TODO
		return null;
	}
	
	public static Cursor getCollections() {
		//TODO 
		return null;
	}
	
}
